package com.zhongfl.crm.model.boss;

import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

/**
 * 收入费用类型
 *
 * @author wang.yuchuan
 * @createdAt 2019/1/18
 */
public enum OrderFeeType {

    FINANCING_SERVICE_FEE(OrderTradeType.INCOME, "融资服务费"),
    WARRANTY_SERVICE_FEE(OrderTradeType.INCOME, "担保服务费"),
    PLATFORM_SERVICE_FEE(OrderTradeType.INCOME, "平台服务费"),
    OTHER_INCOME(OrderTradeType.INCOME, "其它"),
    PACKAGE_SERVICE_FEE(OrderTradeType.OUTCOME, "包装费"),
    OTHER_OUTCOME(OrderTradeType.OUTCOME, "其它");

    @Getter
    private OrderTradeType tradeType;

    @Getter
    private String value;

    OrderFeeType(OrderTradeType tradeType, String value) {
        this.tradeType = tradeType;
        this.value = value;
    }

    public static List<OrderFeeType> getIncomeFeeTypes() {
        List<OrderFeeType> result = new ArrayList<>();

        for (OrderFeeType orderFeeType : OrderFeeType.values()) {
            if (orderFeeType.getTradeType().equals(OrderTradeType.INCOME)) {
                result.add(orderFeeType);
            }
        }

        return result;
    }

    public static List<OrderFeeType> getOutcomeFeeTypes() {
        List<OrderFeeType> result = new ArrayList<>();

        for (OrderFeeType orderFeeType : OrderFeeType.values()) {
            if (orderFeeType.getTradeType().equals(OrderTradeType.OUTCOME)) {
                result.add(orderFeeType);
            }
        }

        return result;
    }
}
